{template 'public/header'}

{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/zh_tcwq/template/public/ygcsslist.css">

<ul class="nav nav-tabs">
  <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div> 
 <li {if $type=='wait'} class="active" {/if}><a href="{php echo $this->createWebUrl('ingoods',array('type'=>wait,'state'=>1));}">待审核</a></li>
 <li {if $type=='ok'} class="active" {/if}><a href="{php echo $this->createWebUrl('ingoods',array('type'=>ok,'state'=>2));}">已确认</a></li>
 <li {if $type=='no'} class="active" {/if}><a href="{php echo $this->createWebUrl('ingoods',array('type'=>no,'state'=>3));}">已拒绝</a></li>
 <li {if $type=='all'} class="active" {/if}><a href="{php echo $this->createWebUrl('ingoods',array('type'=>all));}">全部商品</a></li>
</ul>
<div class="row ygrow">
    <div class="col-lg-12">
        <form action="" method="get" class="col-md-4">
        <input type="hidden" name="c" value="site" />
        <input type="hidden" name="a" value="entry" />
        <input type="hidden" name="m" value="zh_tcwq" />
        <input type="hidden" name="do" value="ingoods" />
            <div class="input-group" style="width: 300px">
                <input type="text" name="keywords" class="form-control" placeholder="请输入商品名称">
                <span class="input-group-btn">
                    <input type="submit" class="btn btn-default" name="submit" value="查找"/>
                </span>
            </div>
            <input type="hidden" name="token" value="{$_W['token']}"/>
        </form>
        <form action="" method="get" class="col-md-4">
    		<input type="hidden" name="c" value="site" />
          	<input type="hidden" name="a" value="entry" />
          	<input type="hidden" name="m" value="zh_tcwq" />
          	<input type="hidden" name="do" value="ingoods" />
            <div class="input-group" style="width: 100px">
                {php echo tpl_form_field_daterange('time');}
                <span class="input-group-btn">
                    <input type="submit" class="btn btn-default" name="submit2" value="查找"/>
                     <input type="hidden" name="token" value="{$_W['token']}"/>
                </span>
            </div><!-- /input-group -->
        </form>
        <div class="col-md-4">
            <input type="hidden" name="token" value="{$_W['token']}"/>
        </div>
    </div><!-- /.col-lg-6 -->
</div>  
<div class="main">
    <div class="panel panel-default">
        <div class="panel-heading">
            商品审核管理
        </div>
        <div class="panel-body" style="padding: 0px 15px;">
            <div class="row">
                <table class="yg5_tabel col-md-12">
                    <tr class="yg5_tr1">
                        <td class="store_td1 col-md-1">id</td>
                        <td class=" col-md-2">所属商家</td>
                        <td class="col-md-1">商品名称</td>
                         <td class="col-md-2">商品价格</td>                 
                        <td class="col-md-2">发布时间</td>
                        <td class="col-md-1">状态</td>
                        <td class="col-md-2">操作</td>
                    </tr>
                    {loop $list $key $item}
                    <tr class="yg5_tr2">
                     <td>{$item['id']}</td>
                        <td>{$item['store_name']}</td>
                        <td>{$item['goods_name']}</td>
                        <td>{$item['goods_cost']}</td>
                       
                        <td>{php echo date('Y-m-d H:i:s',$item['time'])}</td>
                        {if $item['state']==1}
                        <td>
                            <span class="label storered">待审核</span>
                        </td >
                        {elseif $item['state']==2}
                        <td >
                            <span class="label storeblue">已通过</span>
                        </td>
                        {elseif $item['state']==3}
                        <td>
                           <span class="label storegrey">已拒绝</span>
                       </td>
                       {/if} 
                       <td>
                            <a href="{php echo $this->createWebUrl('ingoodsinfo',array('id'=>$item['id']));}" class="storespan btn btn-xs">
                                <span class="fa fa-pencil"></span>
                                <span class="bianji">查看
                                    <span class="arrowdown"></span>
                                </span>                            
                            </a>
                           <!-- <a href="{php echo $this->createWebUrl('ingoodsinfo',array('id'=>$item['id']));}"><button class="btn btn-success">查看</button></a> -->
                           {if $item['state']==1}
                           <a href="{php echo $this->createWebUrl('ingoods',array('op'=>'tg','id'=>$item['id']));}"><button class="btn storesuccess">通过</button></a>
                           <a href="{php echo $this->createWebUrl('ingoods',array('op'=>'jj','id'=>$item['id']));}"><button class="btn storewarning">拒绝</button></a>
                           {/if}
                           <!-- <button type="button" class="btn btn-danger btn-sm" data-toggle="modal" data-target="#myModal{$item['id']}">删</button> -->
                       </td>

                   </tr>
                   <div class="modal fade" id="myModal{$item['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                      <div class="modal-dialog" role="document">
                        <div class="modal-content">
                          <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">提示</h4>
                        </div>
                        <div class="modal-body" style="font-size: 20px">
                            确定删除么？
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                            <a href="{php echo $this->createWebUrl('ingoods', array('op' => 'delete', 'id' => $item['id']))}" type="button" class="btn btn-info" >确定</a>
                        </div>
                    </div>
                </div>
            </div>
            {/loop}
            {if empty($list)}
            <tr class="yg5_tr2">
            <td colspan="9">
                  暂无商品信息
              </td>
          </tr>
          {/if}
      </table>
  </div>
</div>
</div>
</div>
<div class="text-right we7-margin-top">
   {$pager}
</div>
<script type="text/javascript">
    $(function(){
        $("#frame-7").show();
        $("#yframe-7").addClass("wyactive");
    })
</script>